import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("address_tree", { schema: "cbox" })
export class AddressTree {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("bigint", { name: "code", nullable: true, comment: "行政区划代码" })
  code: string | null;

  @Column("varchar", {
    name: "name",
    nullable: true,
    comment: "名称",
    length: 32,
  })
  name: string | null;

  @Column("varchar", {
    name: "province",
    nullable: true,
    comment: "省/直辖市",
    length: 32,
  })
  province: string | null;

  @Column("varchar", {
    name: "city",
    nullable: true,
    comment: "市",
    length: 32,
  })
  city: string | null;

  @Column("varchar", {
    name: "area",
    nullable: true,
    comment: "区",
    length: 32,
  })
  area: string | null;

  @Column("varchar", {
    name: "town",
    nullable: true,
    comment: "城镇地区",
    length: 32,
  })
  town: string | null;
}
